package com.pentalog.rest.spring;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Path("/hello")
public class HelloRestSpring {

	@Autowired
	private IMyService myService;

	// call : http://localhost:8080/rest-example/rest/hello?name=tuong
	@GET
	public Response getMsg(@QueryParam("name") String msg) {

		String output = "Jersey say : " + msg+", "+ myService.callMe();
		return Response.status(200).entity(output).build();

	}

}